package exam.quarzt.domain;

import com.baomidou.mybatisplus.annotation.*;
import exam.domian.base.BaseBean;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Xiongx
 * @version 1.0
 * @date 2021/4/8 16:00
 * @since JDK 1.8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("定时job")
@TableName("sysjob")
public class SysJob extends BaseBean implements Serializable {

    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty("主键id")
    private String id;

    @TableField("job_name")
    @ApiModelProperty("任务名称")
    private String jobname;

    @TableField("job_group")
    @ApiModelProperty("任务组名")
    private String jobgroup;

    @ApiModelProperty("运行状态")
    @TableField("status")
    private Integer status;

    @TableField("type")
    @ApiModelProperty("任务类型")
    private String type;

    @TableField("typecode")
    @ApiModelProperty("类型编码 1 反射 2 rest 3 定时调用")
    private Integer typeCode;

    @TableField("clazz")
    @ApiModelProperty("job反射路径")
    private String clazz;

    @ApiModelProperty("方法名")
    @TableField("methodname")
    private String methodName;

    @ApiModelProperty("反射方法名")
    @TableField("methodclazz")
    private String methodClazz;

    @TableField("params")
    @ApiModelProperty("参数")
    private String param;

    @TableField("rest")
    @ApiModelProperty("rest定时调用")
    private String rest;

    @TableField("cron")
    @ApiModelProperty("cron表达式")
    private String cron;

    @TableLogic()
    @TableField(value = "deletestatus",fill = FieldFill.INSERT)
    @ApiModelProperty("逻辑删除")
    private Integer deleteStatus;

    @ApiModelProperty("创建时间")
    @TableField(value = "createtime",fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "updatetime",fill = FieldFill.UPDATE)
    private Date updateTime;

    @Version//乐观锁Version注解
    @ApiModelProperty("乐观锁")
    @TableField(value = "version",fill = FieldFill.INSERT)
    private Integer version;
}
